A software application typically has a user interface that enables an end user to interact with the functionality of the software application. User interface processing is usually performed on a main (user interface) thread. In some software applications, all processing is performed on the main thread, either because multiple threads are not supported or because the application was written using just one thread. In such scenarios, the user interface waits for all processing to finish before allowing the user to continue interacting with the software application. By pausing further interaction while processing occurs, a user may be given the impression that the software application is “locked up”, when in reality it is just still processing some operation.
Some software applications support the ability to take advantage of multiple threads, where certain background work can be performed separately from the main thread. Such background operations are termed “asynchronous”, because they can be performed independently of the main thread. When an asynchronous operation completes, it calls back a previously designated function to let that function know the work is now completed.
Many programming environments, such as JavaScript running in a web browser, do not support the concept of multiple threads. This is one reason why web pages can hang for long periods as data is fetched or a calculation is executed.